package com.itheima.day12;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        /*
         录入一个数,判断是否是水仙花数
         */
        //1.键盘录入一个三位数的整数
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个三位整数:");
        int num = sc.nextInt();
        int ge = num / 10;
        int shi = num % 10 / 10;
        int bai = num % 100;
        if (num >= 100 && num <= 999) {
            if (ge * ge * ge + shi * shi * shi + bai * bai * bai == num) {
                System.out.println(num + "是水仙花数");
            } else {
                System.out.println(num + "不是是水仙花数");
            }
        } else {
            System.out.println("输出有误!");
        }
    }
}
